
import store from '@/store/getters';
import user from '@/store/modules/user';


/*
    企业致信 各类搜索类型
*/

export const qyzx_qymhcx = 'qyzx_qymhcx';    /// 企业模糊查询
export const qyzx_qyjqcx = 'qyzx_qyjqcx';    /// 企业精确查询
export const qyzx_gqgxcx = 'qyzx_gqgxcx';    /// 股权关系查询
export const qyzx_qyfxcx = 'qyzx_qyfxcx';    /// 企业风险查询
export const qyzx_qyglcx = 'qyzx_qyglcx';    /// 企业关联查询


const jAccountUtil = {

    /**
     *  当前用户 可以查询的项目集合
     */
    currentAccountList: [{ code: qyzx_qymhcx, value: '企业模糊查询', permissionCode: 'account:Like' },
    { code: qyzx_qyjqcx, value: '企业精确查询', permissionCode: 'account:Accuracy' },
    { code: qyzx_gqgxcx, value: '股权关系查询', permissionCode: 'account:Relation' },
    { code: qyzx_qyfxcx, value: '企业风险查询', permissionCode: 'account:Risk' },
    { code: qyzx_qyglcx, value: '企业关联查询', permissionCode: 'account:Connection' },],
    
    currentAccountNameList() {
        return this.currentAccountList.map(item => item.value);
    },


    getAccountWithIndex(index) {
        return this.currentAccountList[index];
    },
    

    /** 
     *  根据 code标识，获取 URL 片段
     */
    getURLWithCode(ID) {

        if (ID === qyzx_qymhcx) {
            return 'costListSumData$api$preAccountQuery';
        }
        else if (ID === qyzx_qyjqcx) {
            return 'costListSumData$api$preAccountDetails';
        }
        else if (ID === qyzx_gqgxcx) {
            return 'costListSumData$api$getShareHolderInfo';
        }
        else if (ID === qyzx_qyfxcx) {
            return 'costListSumData$api$settingUpRiskQry';
        }
        else if (ID === qyzx_qyglcx) {
            return 'costListSumData$api$dictEntRelQuery';
        }

        return '';
    },

}

export default jAccountUtil;







